﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Admin/PMAdmin.Master"
    CodeBehind="DividendReceivables.aspx.cs" Inherits="PM.Site.Admin.DividendReceivables" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <br />
    <div class="form_left">
        <p style="font-size: small; font-weight: bold;">
            Client : &nbsp;<asp:DropDownList ID="ddlClientIds" runat="server" AutoPostBack="true"
                OnSelectedIndexChanged="ddlClientIds_SelectedIndexChanged">
                <asp:ListItem Text="~Select all~" Value="" Selected="True"></asp:ListItem>
            </asp:DropDownList>
        </p>
    </div>
    <br />
    <br />
    <br />
    <div class="form_left">
        <asp:Panel ID="pnlFuDividendRecs" runat="server" Font-Size="Medium" GroupingText="Overview Future Dividend Receivables" >
            <div style="padding: 5px;">
                <asp:DataList ID="dlFuDividends" runat="server" Visible="true" RepeatDirection="Horizontal"
                    CellPadding="0" CellSpacing="0" Font-Size="Small" ItemStyle-BackColor="#F6F4F5"
                    ItemStyle-BorderColor="#6B6B6B" ItemStyle-BorderWidth="1px" HeaderStyle-BackColor="#444444"
                    HeaderStyle-Height="50px" RepeatColumns="1" RepeatLayout="Flow">
                    <AlternatingItemStyle BackColor="#F9F9F9" />
                    <HeaderTemplate>
                        <div style="padding-bottom: 0px; margin: 0px; color: White;">
                            <div style="width: 80px; float: left; text-align: center; font-weight: bold;">
                                Client Id</div>
                            <div style="width: 170px; float: left; text-align: center; font-weight: bold;">
                                Security Id</div>
                            <div style="width: 120px; float: left; text-align: center; font-weight: bold;">
                                Quantity</div>
                            <div style="width: 100px; float: left; text-align: center; font-weight: bold;padding: 0px 5px 0px 5px;">
                                Rate of Dividend</div>
                            <div style="width: 100px; float: left; text-align: center; font-weight: bold;padding: 0px 5px 0px 5px;">
                                With Holding Tax(%)</div>
                            <div style="width: 180px; float: left; text-align: center; font-weight: bold;">
                                Amount</div>
                            <div style="width: 120px; float: left; text-align: center; font-weight: bold; padding-right: 5px;">
                                XD</div>
                        </div>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <div style="float: none; margin-bottom: 0px; min-height: 20px; font-size: small;
                            text-align: center;">
                            <div style="width: 80px; float: left; text-align: center; min-height: 12px; ">
                                <label>
                                    <%# Eval("ClientId")%></label></div>
                            <div style="width: 170px; float: left; min-height: 12px;">
                                <label>
                                    <%# Eval("SecurityId")%></label></div>
                            <div style="width: 110px; float: left; text-align: right; min-height: 12px; padding: 0px 5px 0px 5px;">
                                <label>
                                    <%# Eval("Quantity")%></label></div>
                            <div style="width: 100px; float: left; text-align: right; min-height: 12px; padding:0px 5px 0px 5px;">
                                <label>
                                    <%# Eval("RateOfDividend", "{0:0.00}")%></label></div>
                            <div style="width: 100px; float: left; text-align: right; min-height: 12px; padding: 0px 5px 0px 5px;">
                                <label>
                                    <%# Eval("TaxRate", "{0:0.00}")%></label></div>
                            <div style="width: 160px; float: left; text-align: right; min-height: 12px; padding: 0px 5px 0px 5px;">
                                <label>
                                    <%# Eval("Amount", "{0:0.00}")%></label></div>
                            <div style="width: 127px; float: left; text-align: right; min-height: 12px; padding-right: 5px;">
                                <label>
                                    <%# ((DateTime)Eval("XD")).ToShortDateString() %></label></div>
                        </div>
                    </ItemTemplate>
                </asp:DataList>
            </div>
            <div style="padding: 5px; text-align: center;">
                <asp:Button ID="btnApplyDividends" runat="server" Text="Apply Dividends" OnClick="btnApplyDividends_Click" />
            </div>
        </asp:Panel>
    </div>
    <br style="clear: both;" />
    <br />
    <div class="form_left">
        <asp:Panel ID="pnlDividendReceivables" runat="server" Font-Size="Medium" GroupingText="Overview Dividend Receivables">
            <div style="padding: 5px;">
                <asp:DataList ID="dlDividendRecs" runat="server" Visible="true" RepeatDirection="Horizontal"
                    CellPadding="0" CellSpacing="0" Font-Size="Small" ItemStyle-BackColor="#F6F4F5"
                    ItemStyle-BorderColor="#6B6B6B" ItemStyle-BorderWidth="1px" HeaderStyle-BackColor="#444444"
                    HeaderStyle-Height="50px" RepeatColumns="1" RepeatLayout="Flow">
                    <AlternatingItemStyle BackColor="#F9F9F9" />
                    <HeaderTemplate>
                        <div style="padding-bottom: 0px; height: 30px; margin: 0px; color: White;">
                            <div style="width: 80px; float: left; text-align: center; font-weight: bold;">
                                Client Id</div>
                            <div style="width: 140px; float: left; text-align: center; font-weight: bold;">
                                Security Id</div>
                            <div style="width: 120px; float: left; text-align: center; font-weight: bold;">
                                Quantity</div>
                            <div style="width: 90px; float: left; text-align: center; font-weight: bold; padding:0px 5px 0px 5px;">
                                Rate of Dividend<br />
                                <div style="font-size: smaller">
                                    (per share)</div>
                            </div>
                            <div style="width: 90px; float: left; text-align: center; font-weight: bold; padding:0px 5px 0px 5px;">
                                With Holding Tax(%)
                            </div>
                            <div style="width: 130px; float: left; text-align: center; font-weight: bold;">
                                Amount</div>
                            <div style="width: 70px; float: left; text-align: center; font-weight: bold;">
                                XD</div>
                            <div style="width: 70px; float: left; text-align: center; font-weight: bold;padding:0px 5px 0px 5px;">
                                Payment Date</div>
                            <div style="width: 70px; float: left; text-align: center; font-weight: bold;">
                                Received</div>
                            <div style="width: 252px; float: left; text-align: center; font-weight: bold;">
                                Remarks</div>
                        </div>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <div style="float: none; margin-bottom: 0px; min-height: 15px; font-size: small;
                            text-align: center;">
                            <div style="width: 80px; float: left; text-align: center; min-height: 12px;">
                                <asp:Label runat="server" ID="lblClientId" Text='<%# Eval("ClientId")%>' /></div>
                            <div style="width: 140px; float: left; min-height: 12px;">
                                <asp:Label runat="server" ID="lblSecurityId" Text='<%# Eval("SecurityId")%>' /></div>
                            <div style="width: 110px; float: left; text-align: right; min-height: 12px; padding-right: 10px;">
                                <label>
                                    <%# Eval("Quantity")%></label></div>
                            <div style="width: 90px; float: left; text-align: right; min-height: 12px; padding-right: 10px;">
                                <label>
                                    <%# Eval("RateOfDividend", "{0:0.00}")%></label></div>
                            <div style="width: 90px; float: left; text-align: right; min-height: 12px; padding-right: 10px;">
                                <label>
                                    <%# Eval("TaxRate", "{0:0.00}")%></label></div>
                            <div style="width: 120px; float: left; text-align: right; min-height: 12px; padding-right: 10px;">
                                <label>
                                    <%# Eval("Amount", "{0:0.00}")%></label></div>
                            <div style="width: 70px; float: left; text-align: center; min-height: 12px;">
                                <asp:Label runat="server" ID="lblXD" Text='<%# ((DateTime)Eval("XD")).ToShortDateString() %>' /></div>
                            <div style="width: 70px; float: left; text-align: center; min-height: 12px; padding:0px 5px 0px 5px;">
                                <label>
                                    <%# ((DateTime)Eval("PaymentDate")).ToShortDateString()%></label>
                            </div>
                            <div style="width: 70px; float: left; text-align: center;">
                                <asp:CheckBox ID="chkReceived" Checked='<%#Eval("Received") %>' runat="server" /></div>
                            <div style="width: 250px; float: left; min-height: 12px; text-align: center;">
                                <asp:TextBox ID="txbRemarks" runat="server" TextMode="MultiLine" Width="230px" Text='<%# Eval("Remarks")%>'>                                    
                                </asp:TextBox></div>
                        </div>
                    </ItemTemplate>
                </asp:DataList>
            </div>
            <br />
            <div style="text-align: center;">
                <asp:Button ID="btnUpdate" runat="server" Text="Update" OnClick="btnUpdate_Click" />
            </div>
        </asp:Panel>
    </div>
    <br />
    <div class="horizontal_space_15px">
    </div>
    <div class="separator">
    </div>
    <div class="form_left">
        <asp:Panel ID="pnlSceipDividends" runat="server" Font-Size="Medium" GroupingText="Overview Scrip Dividend Receivables">
            <div style="padding: 5px;">
                <asp:DataList ID="dlSceipDividends" runat="server" Visible="true" RepeatDirection="Horizontal"
                    CellPadding="0" CellSpacing="0" Font-Size="Small" ItemStyle-BackColor="#F6F4F5"
                    ItemStyle-BorderColor="#6B6B6B" ItemStyle-BorderWidth="1px" HeaderStyle-BackColor="#444444"
                    HeaderStyle-Height="30px" RepeatColumns="1" RepeatLayout="Flow">
                    <AlternatingItemStyle BackColor="#F9F9F9" />
                    <HeaderTemplate>
                        <div style="padding-bottom: 0px; height: 30px; margin: 0px; color: White;">
                            <div style="width: 80px; float: left; text-align: center; font-weight: bold;">
                                Client Id</div>
                            <div style="width: 140px; float: left; text-align: center; font-weight: bold;">
                                Security Id</div>
                            <div style="width: 120px; float: left; text-align: center; font-weight: bold;">
                                Quantity<br />
                                <div style="font-size: smaller">
                                    (on hand)</div>
                            </div>
                            <div style="width: 120px; float: left; text-align: center; font-weight: bold; padding-left: 10px;">
                                Propotion<br />
                                <div style="font-size: smaller">
                                    (per share)</div>
                            </div>
                            <div style="width: 120px; float: left; text-align: center; font-weight: bold;">
                                Quantity<br />
                                <div style="font-size: smaller">
                                    (to receive)</div>
                            </div>
                            <div style="width: 100px; float: left; text-align: center; font-weight: bold;">
                                XD</div>
                            <div style="width: 102px; float: left; text-align: center; font-weight: bold;">
                                Scrip Date</div>
                        </div>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <div style="float: none; margin-bottom: 0px; min-height: 15px; font-size: small;
                            text-align: center;">
                            <div style="width: 80px; float: left; text-align: center; min-height: 12px;">
                                <label>
                                    <%# Eval("ClientId")%></label></div>
                            <div style="width: 140px; float: left; min-height: 12px;">
                                <label>
                                    <%# Eval("SecurityId")%></label></div>
                            <div style="width: 100px; float: left; text-align: right; min-height: 12px; padding-right: 20px;">
                                <label>
                                    <%# Eval("Quantity")%></label></div>
                            <div style="width: 100px; float: left; text-align: right; min-height: 12px; padding-right: 30px;">
                                <label>
                                    <%# Eval("Propotion")%></label></div>
                            <div style="width: 100px; float: left; text-align: right; min-height: 12px; padding-right: 20px;">
                                <label>
                                    <%# Eval("QuantityReceivable")%></label></div>
                            <div style="width: 100px; float: left; text-align: center; min-height: 12px;">
                                <label>
                                    <%# ((DateTime)Eval("XD")).ToShortDateString()%></label>
                            </div>
                            <div style="width: 100px; float: left; text-align: center; min-height: 12px;">
                                <label>
                                    <%# ((DateTime)Eval("PaymentDate")).ToShortDateString()%></label>
                            </div>
                        </div>
                    </ItemTemplate>
                </asp:DataList>
            </div>
            <br />
        </asp:Panel>
    </div>
</asp:Content>
